﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.SysManage
{
    public class T_PUB_LIBRARY
    {
        private readonly DALL.SysManage.T_PUB_LIBRARY dal = new DALL.SysManage.T_PUB_LIBRARY();
        public T_PUB_LIBRARY()
        { }
        #region  Method

        /// <summary>
        /// 获得仓库信息和所属店
        /// </summary>
        /// <param name="strDepartID"></param>
        /// <param name="strDepart"></param>
        /// <param name="strUserName"></param>
        /// <returns></returns>
        public DataSet GetLibraryInfo()
        {
            string strWhere = " IS_BRANCH = 1 and IS_LIBRARY = 1";
            return dal.GetLibraryInfo(strWhere);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.SysManage.T_PUB_LIBRARY model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.SysManage.T_PUB_LIBRARY model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int LIBRARY_ID)
        {

            return dal.Delete(LIBRARY_ID);
        }
 

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.SysManage.T_PUB_LIBRARY GetModel(int LIBRARY_ID)
        {

            return dal.GetModel(LIBRARY_ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public List<Model.SysManage.T_PUB_LIBRARY> GetModelByBranch_id(int BRANCH_ID)
        {

            return dal.GetModelByBranch_id(BRANCH_ID);
        }

        /// <summary>
        /// 该店是否存在仓库
        /// </summary>
        public bool Exists(int BRANCH_ID)
        {

            return dal.Exists(BRANCH_ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
   
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.SysManage.T_PUB_LIBRARY> GetModelList(string strWhere)
        {
            return dal.GetListArray(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        #endregion  Method
    }
}
